import 'package:flutter/material.dart';

import '../../tab_bookshelf/data.dart';
import '../../../../widgets/common_image.dart';

class RightList extends StatelessWidget {
  RightList({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var width = MediaQuery.of(context).size.width - 70;
    return Container(
        width: width,
        padding: EdgeInsets.only(top: 6.0, left: 6.0, right: 6.0, bottom: 70.0),
        decoration: BoxDecoration(
            border: Border(left: BorderSide(width: 1.0, color: Colors.grey))),
        child: ListView.builder(
          itemBuilder: (BuildContext context, int index) {
            return Container(
              padding: EdgeInsets.only(bottom: 10.0),
              width: width,
              height: 115.0,
              child: Row(
                children: [
                  Container(
                      width: 100.0,
                      height: 100.0,
                      child: CommonImage(bookInfoData[index].bookImgUrl!)),
                  Expanded(
                      child: Column(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                        Text(
                          bookInfoData[index].title!,
                          style: TextStyle(
                              fontSize: 18.0, fontWeight: FontWeight.w400),
                        ),
                        Text(
                          bookInfoData[index].subTitle!,
                          style: TextStyle(
                              fontSize: 16.0, color: Colors.grey.shade800),
                        ),
                        Text(bookInfoData[index].title!,
                            style: TextStyle(
                              fontSize: 14.0,
                              color: Colors.grey.shade800,
                            )),
                        Text(
                          bookInfoData[index].desc!,
                          maxLines: 1,
                          style: TextStyle(
                              fontSize: 12.0,
                              color: Colors.grey.shade500,
                            )
                        ),
                      ]))
                ],
              ),
            );
          },
          itemCount: bookInfoData.length,
        ));
  }
}
